package studyController;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import vo.StudyVo;
import dao.StudyDao;

@Controller
public class StudyViewController {
	@Autowired
	StudyDao dao;

	@RequestMapping(value="/project/main/study_view.do")
	public ModelAndView exe(StudyVo svo) throws Exception {
		
		List<StudyVo> title_list = dao.selectTitle(svo.getCate_no());
		List<StudyVo> study_list = dao.selectStudy();
		
		
		ModelAndView mv = new ModelAndView();
		mv.addObject("title_list", title_list);
		mv.addObject("study_list", study_list);
		mv.addObject("cate_no", svo.getCate_no());
		mv.addObject("menu_no", svo.getMenu_no());
		mv.setViewName("/project/study/study_view.jsp");
		return mv;
	}

}
